﻿using System;
using Microsoft.SharePoint.Administration;

namespace SharePoint.Contrib.Extensions
{
    /// <summary>
    /// Extensions for the SPDiagnosticsCategory class
    /// </summary>
    public static class SPDiagnosticsCategoryExtensions
    {
        internal static string AreaAndCategory(this SPDiagnosticsCategory instance)
        {
            if (instance.Area == null)
            {
                throw new ArgumentNullException("SPDiagnosticsCategory.Area");
            }

            return string.Concat(instance.Area.Name, "/", instance.Name);
        }
    }
}
